/*
 *	This file is part of Lounge-Cast.
 *
 *  Author:  	Markus Moormann
 *	E-mail:  	mmoorman@uni-osnabrueck.de
 *	Copyright:	University of Osnabrueck (Zentrum Virtuos)
 * 	Website:	www.uni-osnabrueck.de
 *	Date:		16.02.2011
 *
 *	Lounge-Cast is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *	Lounge-Cast is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Lounge-Cast.  If not, see <http://www.gnu.org/licenses/>.
 */
package multimedia.model.vo
{
	/**
	 * class representing an image
	 * subclass of MediaVO
	 * 
	 * @see MediaVO
	 */
	[Bindable]
	[RemoteClass(alias="backend.vo.ImageVO")]
	public class ImageVO extends MediaVO
	{
		
		/**
		 * the URL pointing to the image
		 */
		public var url:String;
		/**
		 * a person holding the rights on the image
		 */
		public var image_source:String;
		/**
		 * whether the image is in composition with a text or not
		 */
		public var in_composition:Boolean;
		/**
		 * the width of the image
		 */
		public var width:Number;
		/**
		 * the height of the image
		 */
		public var height:Number;
		/**
		 * the aspect ratio of the image (width/height)
		 */
		public var aspect_ratio:Number;
		
		/**
		 * default constructor 
		 */
		public function ImageVO(){}
		
		/**
		 * method to get an instance of ImageVO
		 * 
		 * @param media the media containing the common information
		 * @param url the URL pointing to the image
		 * @param image_source a person holding the rights on the image
		 * @param in_composition whether the image is in composition with a text or not
		 * 
		 * @return an instance of ImageVO containing the given information
		 */
		public static function getInstance(media:MediaVO,
										   url:String,
										   image_source:String,
										   in_composition:Boolean):ImageVO
		{
			var image:ImageVO = new ImageVO();
			image.media_id = media.media_id;
			image.added = media.added;
			image.addedBy = media.addedBy;
			image.approved = media.approved;
			image.converted = media.converted;
			image.duration = media.duration;
			image.newsticker = media.newsticker;
			image.playlist_id = media.playlist_id;
			image.position = media.position;
			image.reference = media.reference;
			image.title = media.title;
			image.type = media.type;
			image.start_date = media.start_date;
			image.valid_date = media.valid_date;
			image.category = media.category;
			image.hide_title = media.hide_title;
			
			image.url = url;
			image.image_source = image_source;
			image.in_composition = in_composition;
			
			return image;
		}

	}
}